<div class="tabs">
    <ul>
        <li><a href="#tab_dados">Dados</a></li>
        <li><a href="#tab_residentes">Residentes na Moradia</a></li>
    </ul>
    <div id="tab_dados">
		<?php include_partial('formUsuario', array('form' => $form))?>
    </div>
    <div id="tab_residentes">
    	<?php
			include_partial(
				'residentesMoradia',
				array(
					'form' => new UsuarioForm(),
					'ar_residentes' => $ar_residentes,
					'residente' => $residente,
					'object' => $form->getObject()
				)
			);
        ?>
    </div>
</div>
	
	
<?php
	$button_imprimir = '';
	if(!$form->isNew()):
	$button_imprimir = link_to(
    	':: Imprimir ::',
		url_for('usuario/imprimir?id_usuario='.$form->getObject()->getIdUsuario()),
		array('class'=>'botao')
	);
	endif;
	
	comandos_form(
		link_to(
			':: Voltar ::',
			'usuario/list',
			array('class' => 'botao')
		),
		$button_imprimir . ' ' .button_to_function(
			':: Salvar ::',
			"$('#form_usuario').submit()",
			array('class' => 'botao')
		)
	);
?>

<script type="text/javascript">
$(document).ready(function(){
	var disabled = null;
	<?php if($form->isNew()): ?>
	disabled = { disabled: [1] };
	<?php endif; ?>

	$(".tabs").tabs(disabled);
});
</script>